.traffic-monitor {
  position: relative;
  padding: 20px 20px 5px;
  user-select: none;
  .title-wrap{
    display: flex;
    justify-content: space-between;
    align-items: center;
    .title{
      font-size: 14px;
      color: #ffffff;
    }
  }
  .tab-selector {
    display: flex;
    justify-content: right;
    .tab-item {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 105px;
      height: 30px;
      border: 1px solid #3A4E74;
      cursor: pointer;
      transition: all 0.3s ease;
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      font-size: 14px;
    }
    .tab-item:first-child{
      border-radius: 4px 0 0 4px;
      border-right: none;
    }
    .tab-item:last-child{
      border-radius: 0 4px 4px 0;
      border-left: none;
    }
    .isActive{
      color: rgba(255,255,255,1);
      border: 1px solid #43c3f5 !important;
      background: linear-gradient(to bottom, rgba(67,195,245, 0) 20%, rgba(67,195,245, 1));
    }
    .unActive{
      border: 1px solid #3A4E74 !important;
      background: rgba(5, 18, 34, 0.20);
      color: rgba(255,255,255,0.9);
    }
  }

  .monitor-cards {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    padding: 30px 20px 10px;
    .monitor-card{
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      width: 50%;
      height: 97px;
      margin-bottom: 10px;
      .card-image{
        width: 145px;
        height: 77px;
        margin-bottom: 5px;
        font-size: 30px;
        color: #ffffff;
        .number-str{
          fontFamily: 'SourceHanSansSC, DINAlternate';
          display: flex;
          align-items: center;
          justify-content: center;
          margin-top: 5px;
          text-shadow: 0px 0px 7px rgba(52, 255, 204, 0.1);
          background: linear-gradient(
              180deg,
              rgba(255, 255, 255, 1) 40%,
              rgba(255, 255, 255, 0) 100%
          );
          -webkit-background-clip: text;
          -webkit-text-fill-color: transparent;
        }
      }
    }
  }

  // 主题样式
  &.dark {
    // 默认深色主题
  }

  &.light {
  }

  // 响应式设计
  @media (max-width: 768px) {
    padding: 15px;

    .monitor-title {
      left: 35px;
      top: 15px;
      font-size: calc(16px * 0.9);
    }

    .date-selector {
      left: calc(290px * 0.8);
      top: 12px;

      .date-item {
        width: calc(65px * 0.8);
        height: calc(28px * 0.8);

        .date-text {
          font-size: calc(14px * 0.9);
        }
      }
    }

    .monitor-cards {
      left: calc(62px * 0.8);
      top: calc(153px * 0.8);
      gap: calc(95px * 0.7);

      .monitor-card {
        width: calc(145px * 0.8);
        height: calc(77px * 0.8);

        .card-title {
          font-size: calc(16px * 0.9);
          bottom: calc(-23px * 0.8);
        }
      }
    }
  }

  @media (max-width: 480px) {
    padding: 10px;

    .monitor-title {
      left: 25px;
      top: 10px;
      font-size: calc(16px * 0.8);
    }

    .date-selector {
      left: calc(290px * 0.6);
      top: 8px;

      .date-item {
        width: calc(65px * 0.7);
        height: calc(28px * 0.7);

        .date-text {
          font-size: calc(14px * 0.8);
        }
      }
    }

    .monitor-cards {
      left: calc(62px * 0.6);
      top: calc(153px * 0.6);
      gap: calc(95px * 0.5);
      flex-direction: column;
      gap: 20px;

      .monitor-card {
        width: calc(145px * 0.7);
        height: calc(77px * 0.7);

        .card-title {
          font-size: calc(16px * 0.8);
          bottom: calc(-23px * 0.7);
        }
      }
    }
  }

  // 焦点可访问性
  &:focus-within {
    outline: 2px solid rgba(26, 215, 255, 0.5);
    outline-offset: 2px;
  }

  // 高对比度模式
  @media (prefers-contrast: high) {
    .date-selector .date-item {
      border-width: 2px;
    }

    .monitor-title,
    .card-title {
      text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    }
  }

  // 减少动画
  @media (prefers-reduced-motion: reduce) {
    .monitor-title,
    .date-selector .date-item,
    .monitor-card,
    .card-image {
      transition: none;
      transform: none;
    }

    .monitor-card:hover,
    .card-image:hover {
      transform: none;
    }
  }

  // 加载状态
  &.loading {
    opacity: 0.7;
    pointer-events: none;

    &::after {
      content: '';
      position: absolute;
      top: 50%;
      left: 50%;
      width: 24px;
      height: 24px;
      margin: -12px 0 0 -12px;
      border: 2px solid rgba(255, 255, 255, 0.3);
      border-top-color: #fff;
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }
  }

  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }

  // 无数据状态
  &.no-data {
    .monitor-cards {
      opacity: 0.5;

      &::after {
        content: '暂无监控数据';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        color: rgba(255, 255, 255, 0.6);
        font-size: 14px;
        font-weight: 500;
      }
    }
  }
}
